

<!DOCTYPE html>
<html lang="en" class="no-js">

<head>

    <meta charset="utf-8">
    <title>Fullscreen Login</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="description" content="">
    <meta name="author" content="">

    <!-- CSS -->
    <link rel='stylesheet' href='http://fonts.googleapis.com/css?family=PT+Sans:400,700'>
    <link rel="stylesheet" href="./assets/css/reset.css">
    <link rel="stylesheet" href="./assets/css/supersized.css">
    <link rel="stylesheet" href="./assets/css/style.css">

    <!-- HTML5 shim, for IE6-8 support of HTML5 elements -->
    <!--[if lt IE 9]>
    <script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
    <![endif]-->

</head>

<?php
include_once("../class/admin_class.php");
session_start();
unset($_SESSION['to_admin']);
if ($_POST['button'])
{
    $_admin = new admin_class();
    if ($loginadmin=$_admin->getadminbynamepass($_POST['username'],$_POST['password']))
    {
        if($_SESSION['to_admin']){
            alert("检测到您上个帐号尚未退出登录,请您先安全退出上个帐号或关闭浏览器后再尝试重新登录","?");
        }else{
            $_SESSION['to_admin']=$loginadmin['loginname'];
            $_SESSION['adminid']=$loginadmin['id'];
            $_SESSION['qx']=$loginadmin['group'];
            date_default_timezone_set('PRC');
            $_SESSION['lgdate']=date('Y-m-d H:i:s',time());
            $_SESSION['sclgdate']=$loginadmin['logindate'];
            $update_admin['logindate']=$_SESSION['lgdate'];
            $_SESSION['zq1']=$loginadmin['zq1'];
            $_SESSION['zq2']=$loginadmin['zq2'];
            $_SESSION['zq3']=$loginadmin['zq3'];
            $_SESSION['zq4']=$loginadmin['zq4'];
            $_SESSION['zq5']=$loginadmin['zq5'];
            $_SESSION['zq6']=$loginadmin['zq6'];
            $_SESSION['zq7']=$loginadmin['zq7'];
            $_SESSION['zq8']=$loginadmin['zq8'];
            $_SESSION['zq9']=$loginadmin['zq9'];
            $_SESSION['zq10']=$loginadmin['zq10'];
            $_SESSION['q1']=$loginadmin['q1'];
            $_SESSION['q2']=$loginadmin['q2'];
            $_SESSION['q3']=$loginadmin['q3'];
            $_SESSION['q4']=$loginadmin['q4'];
            $_SESSION['q5']=$loginadmin['q5'];
            $_SESSION['q6']=$loginadmin['q6'];
            $_SESSION['q7']=$loginadmin['q7'];
            $_SESSION['q8']=$loginadmin['q8'];
            $_SESSION['q9']=$loginadmin['q9'];
            $_SESSION['q10']=$loginadmin['q10'];
            $_SESSION['q11']=$loginadmin['q11'];
            $_SESSION['q12']=$loginadmin['q12'];
            $_SESSION['q13']=$loginadmin['q13'];
            $_SESSION['q14']=$loginadmin['q14'];
            $_SESSION['q15']=$loginadmin['q15'];
            $_SESSION['q16']=$loginadmin['q16'];
            $_SESSION['q17']=$loginadmin['q17'];
            $_SESSION['q18']=$loginadmin['q18'];
            $_SESSION['q19']=$loginadmin['q19'];
            $_SESSION['q20']=$loginadmin['q20'];
            $_SESSION['q21']=$loginadmin['q21'];
            $_SESSION['q22']=$loginadmin['q22'];
            $_SESSION['q23']=$loginadmin['q23'];
            $_SESSION['q24']=$loginadmin['q24'];
            $_SESSION['q25']=$loginadmin['q25'];
            $_SESSION['q26']=$loginadmin['q26'];
            $_SESSION['q27']=$loginadmin['q27'];
            $_SESSION['q28']=$loginadmin['q28'];
            $_SESSION['q29']=$loginadmin['q29'];
            $_SESSION['q30']=$loginadmin['q30'];
            $_SESSION['q31']=$loginadmin['q31'];
            $_SESSION['q32']=$loginadmin['q32'];
            $_SESSION['q33']=$loginadmin['q33'];
            $_SESSION['q34']=$loginadmin['q34'];
            $_SESSION['q35']=$loginadmin['q35'];
            $_admin->admin_update($update_admin,$loginadmin['id']);
            echo "<script language=javascript>window.location.href='main.php'</script>";
        }
    }else{
        alert('用户名密码错误,请重新登录','?');
    }
}

if ($_GET['action']=="Quit"){
    $_SESSION['qx']="";
    $_SESSION['to_admin']="";
    $_SESSION['adminid']="";
    $_SESSION['lgdate']="";
    $_SESSION['sclgdate']="";
    $_SESSION['zq1']="";
    $_SESSION['zq2']="";
    $_SESSION['zq3']="";
    $_SESSION['zq4']="";
    $_SESSION['zq5']="";
    $_SESSION['zq6']="";
    $_SESSION['zq7']="";
    $_SESSION['zq8']="";
    $_SESSION['zq9']="";
    $_SESSION['zq10']="";
    $_SESSION['q1']="";
    $_SESSION['q2']="";
    $_SESSION['q3']="";
    $_SESSION['q4']="";
    $_SESSION['q5']="";
    $_SESSION['q6']="";
    $_SESSION['q7']="";
    $_SESSION['q8']="";
    $_SESSION['q9']="";
    $_SESSION['q10']="";
    $_SESSION['q11']="";
    $_SESSION['q12']="";
    $_SESSION['q13']="";
    $_SESSION['q14']="";
    $_SESSION['q15']="";
    $_SESSION['q16']="";
    $_SESSION['q17']="";
    $_SESSION['q18']="";
    $_SESSION['q19']="";
    $_SESSION['q20']="";
    $_SESSION['q21']="";
    $_SESSION['q22']="";
    $_SESSION['q23']="";
    $_SESSION['q24']="";
    $_SESSION['q25']="";
    $_SESSION['q26']="";
    $_SESSION['q27']="";
    $_SESSION['q28']="";
    $_SESSION['q29']="";
    $_SESSION['q30']="";
}

?>
<body>

<div class="page-container">
    <h1>Login</h1>
    <form action="./index.php" method="post">
        <input type="text" name="username" class="username" placeholder="Username">
        <input type="password" name="password" class="password" placeholder="Password">
        <input type="hidden" name="button" class="button" value="1">
        <button type="submit">Sign me in</button>
        <div class="error"><span>+</span></div>
    </form>
    <div class="connect" style="display: none">
        <p>Or connect with:</p>
        <p>
            <a class="facebook" href=""></a>
            <a class="twitter" href=""></a>
        </p>
    </div>
</div>
<div align="center" style="display: none">Collect from <a href="http://www.cssmoban.com/" target="_blank" title="模板之家">模板之家</a></div>

<!-- Javascript -->
<script src="./assets/js/jquery-1.8.2.min.js"></script>
<script src="./assets/js/supersized.3.2.7.min.js"></script>
<script src="./assets/js/supersized-init.js"></script>
<script src="./assets/js/scripts.js"></script>

</body>

</html>

